<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListPropertyTitle}"></h:outputText>
        </ui:define>
        <center>
            <ui:define name="body">
                <div style=" height: auto; width: 200px; float: left;">
                    <h:form>
                        <h:outputLabel value="Address: " for="searchAddress" />
                        <h:inputText id="searchAddress" value="#{propertyController.searchAddress}" title="Address" />
                        <br />
                        <h:outputLabel value="Postcode: " for="searchPostcode" />
                        <h:inputText id="searchPostcode" value="#{propertyController.searchPostcode}" title="Postcode" />
                        <br />
                        <h:outputLabel value="Number Bathroom(min): " for="searchMinNumberBathroom" />
                        <h:inputText id="searchMinNumberBathroom" value="#{propertyController.searchMinNumberBathroom}" title="Number Bathroom(min)" />
                        <br />
                        <h:outputLabel value="Number Bathroom(max): " for="searchMaxNumberBathroom" />
                        <h:inputText id="searchMaxNumberBathroom" value="#{propertyController.searchMaxNumberBathroom}" title="Number Bathroom(max)" />
                        <br />
                        <h:outputLabel value="Number Bedroom(min): " for="searchMinNumberBedroom" />
                        <h:inputText id="searchMinNumberBedroom" value="#{propertyController.searchMinNumberBedroom}" title="Number Bedroom(min)" />
                        <br />
                        <h:outputLabel value="Number Bedroom(max): " for="searchMaxNumberBedroom" />
                        <h:inputText id="searchMaxNumberBedroom" value="#{propertyController.searchMaxNumberBedroom}" title="Number Bedroom(max)" />

                        <br />

                        <h:outputLabel value="Furnished: " for="searchFurnished" />
                        <h:selectOneMenu id="searchFurnished" value="#{propertyController.searchFurnished}" title="Furnished">
                            <f:selectItem itemValue="" itemLabel=""/>
                            <f:selectItem itemValue="True" itemLabel="Yes"/>
                            <f:selectItem itemValue="False" itemLabel="No"/>
                        </h:selectOneMenu>
                        <br />
                        <h:outputLabel value="Type: " for="searchType" />
                        <h:inputText id="searchType" value="#{propertyController.searchType}" title="Type" />
                        <br />
                        <h:outputLabel value="Garden: " for="searchGarden" />
                        <h:selectOneMenu id="searchGarden" value="#{propertyController.searchGarden}" title="Garden">
                            <f:selectItem itemValue="" itemLabel=""/>
                            <f:selectItem itemValue="True" itemLabel="Yes"/>
                            <f:selectItem itemValue="False" itemLabel="No"/>
                        </h:selectOneMenu>
                        <br />

                        <h:commandButton action="#{propertyController.prepareList}" value="Search"/>
                        <br />
                    </h:form>
                </div>
                <div style=" height: auto; width: 824px; float: left; border-left: 10px">
                    <h:form styleClass="jsfcrud_list_form">
                        <h:panelGroup id="messagePanel" layout="block">
                            <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        </h:panelGroup>
                        <h:outputText escape="false" value="#{bundle.ListPropertyEmpty}" rendered="#{propertyController.items.rowCount == 0}"/>
                        <h:panelGroup rendered="#{propertyController.items.rowCount > 0}">
                            <h:outputText value="#{propertyController.pagination.pageFirstItem + 1}..#{propertyController.pagination.pageLastItem + 1}/#{propertyController.pagination.itemsCount}"/>&nbsp;
                            <h:commandLink action="#{propertyController.previous}" value="#{bundle.Previous} #{propertyController.pagination.pageSize}" rendered="#{propertyController.pagination.hasPreviousPage}"/>&nbsp;
                            <h:commandLink action="#{propertyController.next}" value="#{bundle.Next} #{propertyController.pagination.pageSize}" rendered="#{propertyController.pagination.hasNextPage}"/>&nbsp;



                            <h:dataTable value="#{propertyController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                                <h:column>     
                                    <div style="background-color: #DDDDDD; height: auto; width: 600px; float: left;" onmouseover="this.style.backgroundColor='#EEEEEE'" onmouseout="this.style.backgroundColor='#DDDDDD'" >
                                        <div style="background-color: transparent; height: inherit; width: 600px; float: left; margin: 3px 3px 3px 3px;">
                                            <div style="background-color: transparent; height: 70px; width: 100px; float: left; margin: 3px 3px 3px 3px;">
                                                image!!

                                            </div>

                                            <div style="background-color: transparent; height: auto; width: 150px; float: left; margin: 3px 3px 3px 3px;">
                                                address:
                                                <br />
                                                <h:outputText value="#{item.address}"/>
                                                <br />
                                                <h:outputText value="#{item.address2}"/>
                                                <br />
                                                <h:outputText value="#{item.postcode}"/>
                                            </div>
                                            <div style="background-color:transparent; float: left; height: 50px; width: auto; margin:3px 8px 1px 8px;">
                                                type:
                                                <br />
                                                type!!
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin:3px 8px 1px 8px;">
                                                status:
                                                <br />
                                                status
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin: 3px 8px 1px 8px;">
                                                price:
                                                <br />
                                                <h:outputText value="#{item.announceCollection[0].price}"/>
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin:3px 8px 1px 8px;">
                                                bedroom:
                                                <br />
                                                <h:outputText value="#{item.numberBedroom}"/>
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin:3px 8px 1px 8px;">
                                                bathroom:
                                                <br />
                                                <h:outputText value="#{item.numberBathroom}"/>
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin:3px 8px 1px 8px;">
                                                garden:
                                                <br />
                                                <h:outputText value="#{item.garden}"/>
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin:3px 8px 1px 8px;">
                                                furniture:
                                                <br />
                                                <h:outputText value="#{item.furniture}"/>
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin:3px 5px 1px 5px;">
                                                size m²:
                                                <br />
                                                <h:outputText value="#{item.sizeSquareMetre}"/>
                                            </div>
                                            <div style="background-color: transparent; float: left; height: 50px; width: auto; margin:3px 5px 1px 5px;">
                                                status:
                                                <br />
                                                status
                                            </div>
                                            <br />
                                            <div style=" background-color:transparent; float:left; height:auto; width:500; margin:0px 5px 1px 5px;">
                                                Description:
                                                <h:outputText value="#{item.description}"/>
                                            </div>

                                        </div>
                                        <div style=" background-color:transparent; float:right; height:inherit; width:50; margin:  0px 5px 5px 5px;">
                                            <h:commandLink action="#{propertyController.prepareView}" value="#{bundle.ListPropertyViewLink}"/>
                                        </div>

                                        <div style=" background-color:transparent; float:right; height:inherit; width:50; margin:  0px 5px 5px 5px;">

                                            <h:commandLink action="#{propertyController.prepareEdit}" value="#{bundle.ListPropertyEditLink}"/>&nbsp;&nbsp;
                                            <h:commandLink action="#{propertyController.destroy}" value="#{bundle.ListPropertyDestroyLink}"/>


                                        </div>

                                    </div>

                                </h:column>

                            </h:dataTable>





                        </h:panelGroup>
                        <br />
                        <h:commandLink action="#{propertyController.prepareCreate}" value="#{bundle.ListPropertyCreateLink}"/>
                        <br />
                        <br />
                        <h:commandLink value="#{bundle.ListPropertyIndexLink}" action="/index" immediate="true" />
                    </h:form>
                </div>
            </ui:define>
        </center>
    </ui:composition>

</html>
